package com.wondersgroup.fjzlpt.yyzyzx.controller.rest.yyzygl;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import com.quick.framework.util.QuickPrincipalUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSONObject;
import com.quick.framework.boot.web.utils.RequestUtils;
import com.wondersgroup.fjzlpt.yyzyzx.service.inter.yyzygl.CwszService;

/**
 * 床位设置
 * <p>
 * <p>
 * Created by sanma on 2017/8/2.
 */
@RestController
@RequestMapping("/cwsz")
public class CwszRestController {
	
	@Autowired
	private CwszService cwszService;
	
	/**
	 * 保存/修改  床位设置信息
	 * @param map
	 * @return
	 */
	@RequestMapping("save")
	public JSONObject save(HttpServletRequest request){
		Map map = RequestUtils.GetParameterMap(request);
		return cwszService.save(map);
	}
	
	/**
	 * 分页查询床位设置信息
	 * @param map
	 * @return
	 */
	@RequestMapping("queryPage")
	public JSONObject queryPage(HttpServletRequest request){
		String xzqh = QuickPrincipalUtils.getXzqhdm(request);
		Map map = RequestUtils.GetParameterMap(request);
		map.put("XZQHDM",xzqh);
		return cwszService.queryPage(map);
	}
	
	/**
	 * 删除床位设置信息
	 * @param map
	 * @return
	 */
	@RequestMapping("delete")
	public JSONObject delete(HttpServletRequest request){
		Map map = RequestUtils.GetParameterMap(request);
		return cwszService.delete(map);
	}
	
	/**
	 * 查询床位预约优先级
	 * @param map
	 * @return
	 */
	@RequestMapping("queryCwyyyxj")
	public JSONObject queryCwyyyxj(HttpServletRequest request){
		Map map = RequestUtils.GetParameterMap(request);
		return cwszService.queryCwyyyxj(map);
	}
	
	
}
